package com.baizhi.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName t_course
 */
@TableName(value ="t_course")
@Data
public class Course implements Serializable {
    /**
     * 
     */
    @TableId
    private Integer pkCid;

    /**
     * 
     */
    private String courseName;

    /**
     * 
     */
    private String startTime;

    /**
     * 学分
     */
    private Integer credit;

    /**
     * 
     */
    private Integer hours;

    /**
     * 
     */
    private Integer teacherId;

    /**
     * 
     */
    private Integer maxStudents;

    /**
     * 
     */
    private Integer selectedStudents;

    /**
     * 类别
     */
    private String category;

    /**
     * 
     */
    private Date gmtCreate;

    /**
     * 
     */
    private Date gmtModified;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Course other = (Course) that;
        return (this.getPkCid() == null ? other.getPkCid() == null : this.getPkCid().equals(other.getPkCid()))
            && (this.getCourseName() == null ? other.getCourseName() == null : this.getCourseName().equals(other.getCourseName()))
            && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime()))
            && (this.getCredit() == null ? other.getCredit() == null : this.getCredit().equals(other.getCredit()))
            && (this.getHours() == null ? other.getHours() == null : this.getHours().equals(other.getHours()))
            && (this.getTeacherId() == null ? other.getTeacherId() == null : this.getTeacherId().equals(other.getTeacherId()))
            && (this.getMaxStudents() == null ? other.getMaxStudents() == null : this.getMaxStudents().equals(other.getMaxStudents()))
            && (this.getSelectedStudents() == null ? other.getSelectedStudents() == null : this.getSelectedStudents().equals(other.getSelectedStudents()))
            && (this.getCategory() == null ? other.getCategory() == null : this.getCategory().equals(other.getCategory()))
            && (this.getGmtCreate() == null ? other.getGmtCreate() == null : this.getGmtCreate().equals(other.getGmtCreate()))
            && (this.getGmtModified() == null ? other.getGmtModified() == null : this.getGmtModified().equals(other.getGmtModified()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPkCid() == null) ? 0 : getPkCid().hashCode());
        result = prime * result + ((getCourseName() == null) ? 0 : getCourseName().hashCode());
        result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
        result = prime * result + ((getCredit() == null) ? 0 : getCredit().hashCode());
        result = prime * result + ((getHours() == null) ? 0 : getHours().hashCode());
        result = prime * result + ((getTeacherId() == null) ? 0 : getTeacherId().hashCode());
        result = prime * result + ((getMaxStudents() == null) ? 0 : getMaxStudents().hashCode());
        result = prime * result + ((getSelectedStudents() == null) ? 0 : getSelectedStudents().hashCode());
        result = prime * result + ((getCategory() == null) ? 0 : getCategory().hashCode());
        result = prime * result + ((getGmtCreate() == null) ? 0 : getGmtCreate().hashCode());
        result = prime * result + ((getGmtModified() == null) ? 0 : getGmtModified().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", pkCid=").append(pkCid);
        sb.append(", courseName=").append(courseName);
        sb.append(", startTime=").append(startTime);
        sb.append(", credit=").append(credit);
        sb.append(", hours=").append(hours);
        sb.append(", teacherId=").append(teacherId);
        sb.append(", maxStudents=").append(maxStudents);
        sb.append(", selectedStudents=").append(selectedStudents);
        sb.append(", category=").append(category);
        sb.append(", gmtCreate=").append(gmtCreate);
        sb.append(", gmtModified=").append(gmtModified);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}